function [L1,L2,L3,V1,V2,V3,V4,V5,V6,V7,V8,V9] ...
    = EigenSort3x3M(L1,L2,L3,V1,V2,V3,V4,V5,V6,V7,V8,V9)
%% Setup
if nargin<12
    V1 = []; V2 = []; V3 = []; V4 = []; V5 = []; 
    V6 = []; V7 = []; V8 = []; V9 = [];
end
%% Eigen Values
L123 = [];
L123(:,:,:,1) = abs(L1); 
L123(:,:,:,2) = abs(L2); 
L123(:,:,:,3) = abs(L3);
%[L123,idx] = sort(L123,4,'descend');
[L123,idx] = sort(L123,4);

L1s = L1; 
L2s = L2;
L3s = L3;
L1s(idx(:,:,:,1)==2) = L2(idx(:,:,:,1)==2);
L1s(idx(:,:,:,1)==3) = L3(idx(:,:,:,1)==3);
L2s(idx(:,:,:,2)==1) = L1(idx(:,:,:,2)==1);
L2s(idx(:,:,:,2)==3) = L3(idx(:,:,:,2)==3);
L3s(idx(:,:,:,3)==1) = L1(idx(:,:,:,3)==1);
L3s(idx(:,:,:,3)==2) = L2(idx(:,:,:,3)==2);
L1 = L1s;
L2 = L2s;
L3 = L3s;
%% Eigen Vectors
if ~isempty(V1)
V1s = V1; 
V2s = V2;
V3s = V3;
V4s = V4;
V5s = V5;
V6s = V6;
V7s = V7;
V8s = V8;
V9s = V9;

% V123 V456 V789
V1s(idx(:,:,:,1)==2) = V4(idx(:,:,:,1)==2);
V2s(idx(:,:,:,1)==2) = V5(idx(:,:,:,1)==2);
V3s(idx(:,:,:,1)==2) = V6(idx(:,:,:,1)==2);

V1s(idx(:,:,:,1)==3) = V7(idx(:,:,:,1)==3);
V2s(idx(:,:,:,1)==3) = V8(idx(:,:,:,1)==3);
V3s(idx(:,:,:,1)==3) = V9(idx(:,:,:,1)==3);


V4s(idx(:,:,:,2)==1) = V1(idx(:,:,:,2)==1);
V5s(idx(:,:,:,2)==1) = V2(idx(:,:,:,2)==1);
V6s(idx(:,:,:,2)==1) = V3(idx(:,:,:,2)==1);

V4s(idx(:,:,:,2)==3) = V7(idx(:,:,:,2)==3);
V5s(idx(:,:,:,2)==3) = V8(idx(:,:,:,2)==3);
V6s(idx(:,:,:,2)==3) = V9(idx(:,:,:,2)==3);

V7s(idx(:,:,:,3)==1) = V1(idx(:,:,:,3)==1);
V8s(idx(:,:,:,3)==1) = V2(idx(:,:,:,3)==1);
V9s(idx(:,:,:,3)==1) = V3(idx(:,:,:,3)==1);

V7s(idx(:,:,:,3)==2) = V4(idx(:,:,:,3)==2);
V8s(idx(:,:,:,3)==2) = V5(idx(:,:,:,3)==2);
V9s(idx(:,:,:,3)==2) = V6(idx(:,:,:,3)==2);

V1 = V1s;
V2 = V2s;
V3 = V3s;
V4 = V4s;
V5 = V5s;
V6 = V6s;
V7 = V7s;
V8 = V8s;
V9 = V9s;
end
%% End
end